//this引用
public class Date {
    private int year;
    public int month;
    public int day;
    private int clock;



    public Date(int year, int month, int day) {
        this.year = year;
        this.month = month;
        this.day = day;
        System.out.println("Date(int,int,int)方法被调用了");
    }
    public Date() {
        this.year = 1900;
        this.month = 1;
        this.day = 1;
    }
    public Date(int year,int month,int day,int clock) {
        this.year = year;
        this.month = month;
        this.day = day;
        this.clock = clock;
        System.out.println("年" + year+ "月" + month + "日" + day +"时" + clock);
    }
    public Date(int year,int month) {
        this(2000,12,17,12);
        this.year = year;
        this.month = month;
        System.out.println("输出年月：");
    }


//    public static void main(String[] args) {
//        Date d = new Date();
//        d.printDate();
//    }



    public void printDate(){
        Date d = new Date();


        System.out.println(year + "-" + month + "-" + day);

    }
    public Date(String name,int age) {
        this(2001,12,13,15);//只能放第一行
        System.out.println("输出时间：");
    }

    public int getClock() {
        return clock;
    }

    public void setClock(int clock) {
        this.clock = clock;
    }

    public static void main(String[] args) {

    }

    public int getYear() {
        return year;
    }

    public int getMonth() {
        return month;
    }

    public int getDay() {
        return day;
    }


}

class Test {


    public static void main(String[] args) {

        Date d1 = new Date(2001,22,22,33);
        System.out.println(d1.month);
        System.out.println(d1.day);
        System.out.println(d1.getClock());
    }
}

   /* public int year;
    public int month;
    public int day;

    public void setDay(int year,int month,int day) {
        this.year = year;
        this.month = month;
        this.day = day;
    }
    public void printData() {
        System.out.println(year + "/" + month + "/" + day);
    }

    public static void main(String[] args) {
        Data d1 = new Data();
        Data d2 = new Data();
        Data d3 = new Data();

        d1.setDay(2020,2,14);
        d2.setDay(1223,2,1);
        d3.setDay(2222,12,3);

        d1.printData();
        d2.printData();
        d3.printData();

        Data d = new Data();
        d.setDay(2012,1,12);
        d.printData();
    }
}
*/